/*
 * @Author: your name
 * @Date: 2021-05-11 10:24:31
 * @LastEditTime: 2021-05-13 11:12:39
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /vite-project/src/api/user.ts
 */

import http from '@/utils/http';
import { LoginParams, GetUserInfoByUserIdParams } from './userModel';

/**
 * 用户登录
 */
export function loginApi(params: LoginParams) {
    return http.request(
        {
            url: '/user/login',
            method: 'POST',
            params,
        },
        {
            isTransformRequestResult: false,
            isShowSuccessMessage: true,
        }
    );
}

/**
 * 获取用户信息
 */
export function getUserInfoById(params: GetUserInfoByUserIdParams) {
    return http.request({
        url: '/user/getUserInfoById',
        method: 'POST',
        params,
    });
}
